<template>
  <div>
    <h1>movieList</h1>
    <p>count 的个数为{{ count }}</p>
    <button @click="addsn({ n: 111 })">增加count</button>
    <button @click="getMovelist">获取电影列表</button>
    <ul>
      <li v-for="item of movieList" :key="item.tvId">
        {{ item.name }}
      </li>
    </ul>
  </div>
</template>

<script>
import { mapState, mapMutations } from 'vuex'
export default {
  methods: {
    ...mapMutations('count', ['addsn']),
    getMovelist() {
      this.$store.dispatch('getMovieList')
    },
  },
  computed: {
    movieList() {
      return this.$store.state.movie.movieList
    },
    ...mapState('count', ['count']),
  },
}
</script>

<style></style>
